package main

import (
	startup2 "git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/startup"
	"log"

	"git.myscrm.cn/golang/stark/v4"
	"git.myscrm.cn/golang/stark/v4/app"
)

// 此处定义当前服务的名字
const APP_NAME = "micro-gfyx-api"

func main() {
	runer, err := app.NewRunner(&stark.Application{
		Name:             APP_NAME,
		Type:             stark.APP_TYPE_GIN,
		LoadConfig:       startup2.LoadConfig,
		SetupVars:        startup2.SetupVars,
		RegisterCallback: map[stark.CallbackPos]func() error{},
	})
	if err != nil {
		log.Fatalf("app.NewRunner err: %v", err)
	}
	err = runer.ListenGinServer(&stark.GinApplication{
		RegisterHttpRoute: startup2.RegisterHttpRoute,
	})
	if err != nil {
		log.Fatalf("runer.ListenGRPCServer err: %v", err)
	}
}
